package cn.zxy.controller;

import cn.zxy.model.EduInfo;
import cn.zxy.model.EduInfoQuery;
import cn.zxy.service.EduInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/eduInfo")
public class EduInfoController {

    @Autowired
    private EduInfoService eduInfoService;

    @GetMapping
    public List<EduInfo> select(EduInfoQuery query){

        //int a=5/0;

        return eduInfoService.select(query);

    }

    @PostMapping
    public Integer insert(@RequestBody EduInfo eduInfo){
        return eduInfoService.insert(eduInfo);
    }
    @PutMapping
    public Integer update(@RequestBody EduInfo eduInfo){
        return eduInfoService.update(eduInfo);
    }

    @DeleteMapping
    public Integer delete(Integer id){
        return eduInfoService.delete(id);
    }

}
